package com.innovation.chengzhangriji.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.innovation.chengzhangriji.R;

public class TipDialogActivity extends BaseActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setBackgroundDrawableResource(android.R.color.transparent);
        setContentView(R.layout.activity_tip_dialog);
        ImageView imageTip = (ImageView) findViewById(R.id.image_tip);
        ImageView imageTipBtn = (ImageView) findViewById(R.id.image_tip_btn);
        imageTipBtn.setOnClickListener(this);

        Intent intent = getIntent();
        int state = intent.getIntExtra("state", 0);
        int welcomeType = intent.getIntExtra("welcome", 0);
        switch (state) {
            case 0: // 欢迎
                if (welcomeType == 0) { // 超级管理员
                    imageTip.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_permission));
                    imageTipBtn.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_btn_permission));
                } else if (welcomeType == 1) { // 加入的人
                    imageTip.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_welcome));
                    imageTipBtn.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_btn_welcome));
                }
                break;
            case 1: // 超级管理员
                imageTip.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_super_admin));
                imageTipBtn.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_btn_super_admin));
                break;
            case 2: // 管理员
                imageTip.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_admin));
                imageTipBtn.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_btn_admin));
                break;
            case 3: // 一起记
                imageTip.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_permission));
                imageTipBtn.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_btn_permission));
                break;
            case 4: // 变更为家长
                imageTip.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_super));
                imageTipBtn.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_btn_super));
                break;
            case 5: // 变更为成员
                imageTip.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_normal));
                imageTipBtn.setImageDrawable(getResources().getDrawable(R.drawable.bg_tip_btn_normal));
                break;
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.image_tip_btn:
                finish();
                break;
        }
    }
}
